package com.ygk.bluepath.member.Presenter;

import com.ygk.bluepath.R;
import com.ygk.bluepath.core.BFragment;
import com.ygk.bluepath.core.BPresenterFragment;
import com.ygk.bluepath.core.BView;
import com.ygk.bluepath.member.View.RegisterActivity;
import com.ygk.bluepath.member.View.RegisterFragmentTwoView;

import utils.ImageUtil;

/**
 * Created by Handreace on 16-7-13.
 */
public class RegisterPresenterFragmentTwo extends BPresenterFragment {

    // private int takePicType=0;//选择图片的类型:默认0 身份证正面照;1 身份证背面照 ; 2 身份证半身照
    private RegisterFragmentTwoView registerFragmentTwoView;

    public RegisterPresenterFragmentTwo(BFragment fragment, BView mView) {
        super(fragment, mView);
        registerFragmentTwoView = (RegisterFragmentTwoView) mView;
    }

    public void choosePic() {
        ImageUtil.showChooseDialog(getActivity());
    }

    public void next(String realName, String identification, String password, String repeatPassword, boolean isChooseFront, boolean isChooseBack, boolean isChooseFace) {

        ((RegisterActivity) getActivity()).changeFragment(2);
        return;
        //实际使用时,注释掉上面的代码
       /* if (realName.isEmpty()) {
            tt(getActivity().getResources().getString(R.string.realNameIsEmpty));
            return;
        } else if (identification.isEmpty()) {
            tt(getActivity().getResources().getString(R.string.identificationIsEmpty));
            return;
        } else if (password.isEmpty()) {
            tt(getActivity().getResources().getString(R.string.passwordIsEmpty));
            return;
        } else if (repeatPassword.isEmpty()) {
            tt(getActivity().getResources().getString(R.string.repeatPasswordIsEmpty));
            return;
        } else if (isChooseFront) {
            tt(getActivity().getResources().getString(R.string.chooseIdentificationFront));
            return;
        } else if (isChooseBack) {
            tt(getActivity().getResources().getString(R.string.chooseIdentificationBack));
            return;
        } else if (isChooseFace) {
            tt(getActivity().getResources().getString(R.string.chooseIdentificationFace));
            return;
        }

        if (!password.equals(repeatPassword)) {
            tt(getActivity().getResources().getString(R.string.passwordIsNotEqual));
            return;
        }

        ((RegisterActivity) getActivity()).setRealName(realName);
        ((RegisterActivity) getActivity()).setIdentificationNum(identification);
        ((RegisterActivity) getActivity()).setPassword(password);

        ((RegisterActivity) getActivity()).changeFragment(2);*/
    }
}
